﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InvestmentIntelligence.DbModel.Models.Mapping
{
    class ActionLogMap : EntityTypeConfiguration<ActionLog>
    {
        public ActionLogMap()
        {
            this.ToTable("ActionLog", "Logging");
            // Columns
            this.HasKey(t => t.Id);
            this.Property(t => t.Date).HasColumnType("datetime");
            this.Property(t => t.Action);
            this.Property(t => t.ActionFamily);
            this.Property(t => t.IPAddress);
            this.Property(t => t.Details);
            this.Property(t => t.UserId);
            this.Property(t => t.ApplicationName);

            //Relations
            this.HasRequired(t => t.User);
        }
    }
}
